package com.parking.mgr.useraccount.model.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.parking.mgr.common.pojo.base.entity.BaseEntity;
import com.parking.mgr.common.pojo.base.node.BaseTreeNode;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.List;

/**
 * @ClassName BasicCodeEntity
 * @Description 数据字典对象
 * @Auther: shilintao
 * @Date 2023/5/22
 */
@EqualsAndHashCode(callSuper = true)
@Data
@TableName("t_basic_code")
public class BasicCodeEntity extends BaseEntity implements BaseTreeNode {

    @TableId(type = IdType.ASSIGN_UUID, value = "pk_id")
    private String id;

    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String fkParentId;

    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String fName;

    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String fNameI18nTextKey;

    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String fKey;

    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String fValue;

    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String fComment;

    @TableField(fill = FieldFill.INSERT)
    private Integer fSortNumber;

    /**
     * 子节点（表中不存在，用于构造树）
     */
    @TableField(exist = false)
    private List children;

    @Override
    public void setChildren(List children) {
        this.children = children;
    }

    @Override
    public String toString() {
        return "BasicCodeEntity{" +
                "pkId='" + id + '\'' +
                '}';
    }
}
